home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / DisAsmLookup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-30  |  22.6 KB  |  489 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        DisAsmLookup.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __DISASMLOOKUP__
  13. #define __DISASMLOOKUP__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19.  
  20. typedef enum {_A0_, _A1_, _A2_, _A3_, _A4_, _A5_, _A6_, _A7_, _PC_, _ABS_, _TRAP_, _IMM_} LookupRegs;
  21.         
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /*----------------------------------------------------------------------------*/
  27.  
  28. pascal void Disassembler(long     DstAdjust,                 /* Address correction                    */
  29.                                                  short *BytesUsed,             /* Bytes used up by 1 call        */  
  30.                                                  Ptr     FirstByte,                /* Ptr to 1st byte                        */
  31.                                                  char     *Opcode,                     /* Ptr to opcode string         */
  32.                                                  char     *Operand,                 /* Ptr to operand string        */
  33.                                                  char     *Comment,                 /* Ptr to comment string         */
  34.                                                   Ptr     LookUpProc);            /* Ptr to PASCAL proc or NULL    */
  35.     /*
  36.     Disassembler is a Pascal routine to be called to disassemble a sequence of
  37.     bytes.  All MC68xxx, MC68881, and MC68851 instructions are supported.  The
  38.     sequence of bytes to be disassembled are pointed to by FirstByte.  BytesUsed
  39.     bytes starting at FirstByte are consumed by the disassembly, and the Opcode,
  40.     Operand, and Comment strings returned as NULL TERMINATED Pascal strings (for
  41.     easier manipulation with C).  The caller is then free to format or use the
  42.     output strings any way appropriate to the application.
  43.  
  44.     Depending on the opcode and effective address(s) (EA's) to be disassembled,
  45.     the Opcode, Operand, and Comment strings contain the following information:
  46.     
  47.     Case                     Opcode    Operand    Comment
  48.     =======================================================================
  49.     Non PC-relative EA's     op.sz     EA's                ; 'c…' (for immediates)
  50.     PC-relative EA's         op.sz     EA's       ; address
  51.     Toolbox traps            DC.W      $AXXX      ; TB XXXX
  52.     OS traps                 DC.W      $AXXX      ; OS XXXX
  53.     Invalid bytes            DC.W      $XXXX      ; ????
  54.     =======================================================================
  55.     
  56.     For valid disassembly of processor instructions the appropriate MC68XXX
  57.     opcode mnemonic is generated for the Opcode string along with a size
  58.     attribute when required. The source and destination EA's are generated as the
  59.     Operand along with a possible comment.  Comments start with a ';'.  Traps use
  60.     a DC.W assembler directive as the Opcode with the trap word as the Operand
  61.     and a comment indicating whether the trap is a toolbox or OS trap and what
  62.     the trap number is.  As described later the caller can generate symbolic
  63.     substitutions into EA's and provide names for traps.
  64.  
  65.     Invalid instructions cause the string 'DC.W' to be returned in the Opcode
  66.     string. Operand is '$XXXX' (the invalid word) with a comment of '; ????'.
  67.   BytesUsed is 2. This is similar to the trap call case except for the comment.
  68.  
  69.     Note, the Operand EA's is syntatically similar to but NOT COMPATIBLE with the
  70.     MPW assembler!    This is because the Disassembler generates byte hex constants
  71.     as "$XX" and word hex constants as "$XXXX".  Negative values (e.g., $FF or
  72.     $FFFF) produced by the Disassembler are treated as long word values by the MPW
  73.     assembler.  Thus it is assumed that Disassembler output will NOT be used as
  74.     MPW assembler input. If that is the goal, then the caller must convert strings
  75.     of the form $XX or $XXXX in the Operand string to their decimal equivalent.
  76.     The routine ModifyOperand is provided in this unit to aid with the conversion
  77.     process.
  78.  
  79.     Since a PC-relative comment is an address, the only address that the
  80.     Disassembler knows about is the address of the code pointed to by FirstByte.
  81.   Generally, that may be a buffer that has no relation to "reality", i.e., the
  82.     actual code loaded into the buffer.  Therefore, to allow the address comment
  83.     to be mapped back to some actual address the caller may specify an adjustment
  84.     factor, specified by DstAdjust that is ADDED to the value that normally would
  85.     be placed in the comment.
  86.  
  87.     Operand effective address strings are generated as a function of the 
  88.     effective address mode and a special case is made for A-trap opcode strings.
  89.     In places where a possible symbolic reference could be substituted for an
  90.     address (or a portion of an address), the Disassembler can call a user
  91.     specified routine to do the substitution (using th LookupProc parameter
  92.     described later).  The following table summarizes the generated effective
  93.     addresses and where symbolic substitutions (S) can be made:
  94.              
  95.     Mode    Generated Effective Address  Effective Address with Substitution
  96.   ========================================================================
  97.         0     Dn                           Dn
  98.         1     An                           An
  99.         2     (An)                         (An)
  100.         3     (An)+                        (An)+
  101.         4     -(An)                        -(An)
  102.         5     ∂(An)                        S(An) or just S (if An=A5, ∂≥0)
  103.      6n     ∂(An,Xn.Size*Scale)          S(An,Xn.Size*Scale)
  104.      6n     (BD,An,Xn.Size*Scale)        (S,An,Xn.Size*Scale)
  105.      6n     ([BD,An],Xm.Size*Scale,OD)   ([S,An],Xm.Size*Scale,OD)
  106.      6n     ([BD,An,Xn.Size*Scale],OD)   ([S,An,Xn.Size*Scale],OD)
  107.      70     ∂                            S
  108.      71     ∂                            S
  109.      72     *±∂                          S
  110.      73     *±∂(Xn.Size*Scale)           S(Xn.Size*Scale)
  111.      73     (*±∂,Xn.Size*Scale)          (S,Xn.Size*Scale)
  112.      73     ([*±∂],Xm.Size*Scale,OD)     ([S],Xm.Size*Scale,OD)
  113.      73     ([*±∂,Xn.Size*Scale],OD)     ([S,Xn.Size*Scale],OD)
  114.      74     #data                        S (#data made comment)
  115.     A-traps $AXXX                        S (as opcode, AXXX made comment)
  116.   ========================================================================
  117.  
  118.   For A-traps, the substitution can be performed to substitute for the DC.W
  119.     opcode string.  If the substitution is made then the Disassembler will
  120.     generate ,Sys and/or ,Immed flags as operands for Toolbox traps and
  121.     ,AutoPop for OS traps when the bits in the trap word indicates these
  122.     settings.
  123.     
  124.                     |         Generated          |            Substituted
  125.                     | Opcode  Operand  Comment   | Opcode  Operand        Comment
  126.   ========================================================================
  127.     Toolbox | DC.W    $AXXX    ; TB XXXX | S       [,Sys][,Immed] ; AXXX
  128.     OS      | DC.W    $AXXX    ; OS XXXX | S       [,AutoPop]     ; AXXX
  129.   ========================================================================
  130.  
  131.     All displacements (∂, BD, OD) are hexadecimal values shown as a byte ($XX),
  132.     word ($XXXX), or long ($XXXXXXXX) as appropriate. The *Scale is suppressed if
  133.     1. The Size is W or L.  Note that effective address substitutions can only be
  134.     made for "∂(An)", "BD,An", and "*±∂" cases.
  135.             
  136.     For all the effective address modes 5, 6n, 7n, and for A-traps, a coroutine (a
  137.     procedure) whose address is specified by the LookupProc parameter is called by
  138.     the Disassembler (if LookupProc is not NIL) to do the substitution (or A-trap
  139.     comment) with a string returned by the proc.  It is assumed that the proc
  140.     pointed to by LookupProc is a level 1 Pascal proc declared as follows:
  141.  
  142.     PROCEDURE Lookup(         PC:      UNIV Ptr;     {Addr of extension/trap word}
  143.                                              BaseReg: LookupRegs;   {Base register/lookup mode  }
  144.                                              Opnd:    UNIV LongInt; {Trap word, PC addr, disp.  }
  145.                                      VAR S:       Str255);             {Returned substitution      }
  146.         
  147.     or in C,
  148.     
  149.     pascal void LookUp(Ptr         PC, 
  150.                        LookupRegs  BaseReg, 
  151.                                          long        Opnd, 
  152.                                          char        *S); 
  153.  
  154.     PC      = Pointer to instruction extension word or A-trap word in the
  155.                         buffer pointed to by the Disassembler's FirstByte parameter.
  156.                         
  157.     BaseReg = This determines the meaning of the Opnd value and supplies
  158.                         the base register for the "∂(An)", "BD,An", and "*±∂" cases.
  159.                         BaseReg may contain any one of the following values:
  160.                      
  161.                         _A0_    =  0 ==> A0
  162.                         _A1_    =  1 ==> A1
  163.                         _A2_    =  2 ==> A2
  164.                         _A3_    =  3 ==> A3
  165.                         _A4_    =  4 ==> A4
  166.                         _A5_    =  5 ==> A5
  167.                         _A6_    =  6 ==> A6
  168.                         _A7_    =  7 ==> A7
  169.                         _PC_    =  8 ==> PC-relative (special case)
  170.                         _ABS_   =  9 ==> Abs addr    (special case)
  171.                         _TRAP_  = 10 ==> Trap word   (special case)
  172.                   _IMM_        = 11 ==> Immediate   (special case)
  173.                         
  174.                         For absolute addressing (modes 70 and 71), BaseReg contains _ABS_.
  175.                         For A-traps, BaseReg would contain _TRAP_.  For immediate data (mode
  176.                         74), BaseReg would contain _IMM_.
  177.  
  178.     Opnd    = The contents of this LongInt is determined by the BaseReg parameter
  179.                         just described.
  180.                  
  181.                         For BaseReg = _IMM_ (immediate data):
  182.                               Opnd contains the (extended) 32-bit immediate data specified by
  183.                                 the instruction.
  184.  
  185.                         For BaseReg = _TRAP_ (A-traps):
  186.                                 Opnd is the entire trap word. The high order 16 bits of Opnd are
  187.                                 zero.
  188.  
  189.                         For BaseReg = _ABS_  (absolute effective address):
  190.                                 Opnd contains the (extended) 32-bit address specifed by the
  191.                                 instruction's effective address.  Such addresses would generally
  192.                                 be used to reference low memory globals on a Macintosh.
  193.  
  194.                         For BaseReg = _PC_  (PC-relative effective address):
  195.                                 Opnd contains the 32-bit address represented by "*±∂" adjusted
  196.                                 by the Disassembler's DstAdjust parameter.
  197.                                 
  198.                         For BaseReg = _An_  (effective address with a base register):
  199.                                 Opnd contains the (sign-extended) 32-bit (base) displacement
  200.                                 from the instruction's effective address.
  201.                                 
  202.                                 In the Macintosh environment, a BaseReg specifying A5 implies
  203.                                 either global data references or Jump Table references. Positive
  204.                                 Opnd values with an A5 BaseReg thus mean Jump Table references,
  205.                                 while a negative offset would mean a global data reference.
  206.                                 Base registers of A6 or A7 would usually mean local data.
  207.  
  208.     S       = Pascal string returned from Lookup containing the effective address
  209.                         substitution string or a trap name for A-traps.  S is set to null
  210.                         PRIOR to calling Lookup.  If it is still null on return, the string
  211.                         is not used.  If not null, then for A-traps, the returned string is
  212.                         used as a opcode string. In all other cases the string is
  213.                         substituted as shown in the above table.
  214.                          
  215.     Depending on the application, the caller has three choices on how to use the
  216.     Disassembler and an associated Lookup proc:
  217.  
  218.     (1). The caller can call just the Disassembler and provide his own Lookup
  219.              proc. In that case the calling conventions discussed above must be
  220.              followed.
  221.  
  222.     (2). The caller can provide NIL for the LookupProc parameter, in which case,
  223.              NO Lookup proc will be called.
  224.              
  225.     (3). The caller can call first InitLookup (described below, a proc provided
  226.              with this unit) and pass the address of this unit's standard Lookup proc
  227.              when Disassembler is called.    In this case all the control logic to
  228.              determine the kind of substitution to be done is provided for the caller
  229.              and all that need to be provided by the user are routines to look up any
  230.              or all of the following:
  231.              
  232.              • PC-relative references
  233.              • Jump Table references
  234.              • Absolute address references
  235.              • Trap names
  236.              • Immediate data names
  237.              • References with offsets from base registers                                                    */
  238.                 
  239.  
  240. pascal void InitLookup(Ptr PCRelProc, Ptr JTOffProc, Ptr TrapProc,
  241.                                              Ptr AbsAddrProc, Ptr IdProc, Ptr ImmDataProc);
  242.     /*
  243.     Prepare for use of this unit's Lookup proc.  When Disassembler is called
  244.     and the address of this unit's Lookup proc is specified, then for immeduate 
  245.     data, PC-relative, Jump Table references, A-traps, absolute addresses, and
  246.     offsets from a base register, the associated level 1 Pascal proc specified
  247.     here is called (if not NULL -- all five addresses are preset to NULL). The
  248.     calls assume the following declarations for these procs (see Lookup, below
  249.     for further details):
  250.                                                              
  251.     PROCEDURE PCRelProc(Address: UNIV LongInt;
  252.                                             VAR S:     UNIV Str255);
  253.  
  254.     PROCEDURE JTOffProc(A5JTOffset: UNIV Integer;
  255.                                             VAR S:        UNIV Str255);
  256.  
  257.     PROCEDURE TrapNameProc(TrapWord: UNIV Integer;
  258.                                                  VAR S:       UNIV Str255);
  259.                                                     
  260.     PROCEDURE AbsAddrProc(AbsAddr: UNIV LongInt;
  261.                                                 VAR S:     UNIV Str255);
  262.  
  263.     PROCEDURE IdProc(BaseReg: LookupRegs;
  264.                                      Offset:  UNIV LongInt;
  265.                                      VAR S:      UNIV Str255);
  266.                                                              
  267.     PROCEDURE ImmDataProc(ImmData: UNIV LongInt;
  268.                                                 VAR S:     UNIV Str255);
  269.                                          
  270.     or in C,
  271.     
  272.     pascal void PCRelProc(long Address, char *S)
  273.     
  274.     pascal void JTOffProc(short A5JTOffset, char *S)
  275.     
  276.     pascal void TrapNameProc(unsigned short TrapWord, char *S)
  277.     
  278.     pascal void AbsAddrProc(long AbsAddr, char *S)
  279.     
  280.     pascal void IdProc(LookupRegs BaseReg, long Offset, char *S)
  281.     
  282.     pascal void ImmDataProc(long ImmData, char *S)
  283.  
  284.     Note: InitLookup contains initialized data which requires initializing at load
  285.                 time (this is of concern only to users with assembler main programs).
  286. */
  287.  
  288.     
  289. pascal void Lookup(Ptr         PC,            /* Addr of extension/trap word                */
  290.                                      LookupRegs  BaseReg, /* Base register/lookup mode                  */
  291.                                      long        Opnd,        /* Trap word, PC addr, disp.                  */
  292.                                      char        *S);             /* Returned substitution                            */
  293.     /*
  294.     This is a standard Lookup proc available to the caller for calls to the
  295.     Disassembler.    If the caller elects to use this proc, then InitLookup MUST be
  296.     called prior to any calls to the Disassembler.  All the logic to determine the
  297.     type of lookup is done by this proc.  For PC-relative, Jump Table references,
  298.     A-traps, absolute addresses, and offsets from a base register, the associated
  299.     level 1 Pascal proc specified in the InitLookup call (if not NULL) is called.
  300.  
  301.     This scheme simplifies the Lookup mechanism by allowing the caller to deal
  302.     with just the problems related to the application.
  303.     */
  304.  
  305.  
  306. pascal void LookupTrapName(unsigned short TrapWord, char *S);
  307.     /*
  308.     This is a procedure provided to allow conversion of a trap instruction (in
  309.      TrapWord) to its corresponding trap name (in S).  It is provided primarily for
  310.      use with the Disassembler and its address may be passed to InitLookup above for
  311.      use by this unit's Lookup routine.  Alternatively, there is nothing prohibiting
  312.      the caller from using it directly for other purposes or by some other lookup
  313.      proc.
  314.  
  315.  Note: The tables in this proc make the size of this proc about 9500 bytes.  The
  316.              trap names are fully spelled out in upper and lower case.
  317.  */
  318.  
  319.  
  320. pascal void ModifyOperand(char *operand);
  321.     /*
  322.     Scan an operand string, i.e., the null terminated Pascal string returned by
  323.     the Disassembler (null MUST be present here) and modify negative hex values to
  324.     negated positive value. For example, $FFFF(A5) would be modified to -$0001(A5).
  325.   The operand to be processed is    passed as the function's parameter which is
  326.     edited "in place" and returned to the caller.
  327.  
  328.     This routine is essentially a pattern matcher and attempts to only modify 2, 4,
  329.     and 8 digit hex strings in the operand that "might" be offsets from a base
  330.     register.  If the matching tests are passed, the same number of original digits
  331.     are output (because that indicates a value's size -- byte, word, or long).
  332.  
  333.     For a hex string to be modified, the following tests must be passed:
  334.  
  335.     • There must have been exactly 2, 4, or 8 digits.
  336.  
  337.         Only hex strings $XX, $XXXX, and $XXXXXXXX are possible candidates because
  338.         that is the only way the Disassembler generates offsets.
  339.  
  340.     • Hex string must be delimited by a "(" or a ",".
  341.  
  342.         The "(" allows offsets for $XXXX(An,...) and $XX(An,Xn) addressing modes.
  343.         The comma allows for the MC68020 addressing forms.
  344.  
  345.     • The "$X..." must NOT be preceded by a "±".
  346.  
  347.         This eliminates the possibility of modifying the offset of a PC-relative
  348.         addressing mode always generated in the form "*±$XXXX".
  349.     
  350.     • The "$X..." must NOT be preceded by a "#".
  351.     
  352.         This eliminates modifying immediate data.
  353.  
  354.     • Value must be negative.
  355.  
  356.         Negative values are the only values we modify.  A value $FFFF is modified to
  357.         -$0001.
  358.     */
  359.     
  360.     
  361. extern char *validMacsBugSymbol(char *symStart, void *limit,
  362.                                                                 char *symbol);
  363.     /*
  364.     Check that the bytes pointed to by symStart represents a valid MacsBug symbol.
  365.     The symbol must be fully contained in the bytes starting at symStart, up to,
  366.     but not including, the byte pointed to by the limit parameter.
  367.     
  368.     If a valid symbol is NOT found, then NULL is returned as the function's result.
  369.     However, if a valid symbol is found, it is copied to symbol (if it is not NULL)
  370.     as a null terminated Pascal string, and return a pointer to where we think the
  371.     FOLLOWING module begins. In the "old style" cases (see below) this will always
  372.     be 8 or 16 bytes after the input symStart.  For new style Apple Pascal and C
  373.     cases this will depend on the symbol length, existence of a pad byte, and size
  374.     of the constant (literal) area.  In all cases, trailing blanks are removed from
  375.     the symbol.
  376.     
  377.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  378.     upper/lower case letters in a format determined by the first two bytes of the
  379.     symbol as follows:
  380.     
  381.      1st byte  | 2nd byte  |  Byte  |
  382.          Range   |  Range    | Length | Comments
  383.     ==============================================================================
  384.      $20 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  385.      $A0 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  386.     ------------------------------------------------------------------------------
  387.      $20 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  388.      $A0 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  389.     ------------------------------------------------------------------------------
  390.      $80       | $01 - $FF |    n   | n = 2nd byte       (Apple Compiler symbol)
  391.      $81 - $9F | $00 - $FF |    m   | m = 1st byte & $7F (Apple Compiler symbol)
  392.     ==============================================================================
  393.     
  394.     The formats are determined by whether bit 7 is set in the first and second
  395.     bytes.  This bit will removed when we find it or'ed into the first and/or
  396.     second valid symbol characters.
  397.     
  398.     The first two formats in the above table are the basic "old style" (pre-
  399.     existing) MacsBug formats. The first byte may or may not have bit 7 set the
  400.     second byte is a valid symbol character.  The first byte (with bit 7 removed)
  401.     and the next 7 bytes are assumed to comprise the symbol.
  402.     
  403.     The second pair of formats are also "old style" formats, but used for MacApp
  404.     symbols.  Bit 7 set in the second character indicates these formats. The symbol
  405.     is assumed to be 16 bytes with the second 8 bytes preceding the first 8 bytes
  406.     in the generated symbol.  For example, 12345678abcdefgh represents the symbol
  407.     abcdefgh.12345678.
  408.     
  409.     The last pair of formats are reserved by Apple and generated by the MPW Pascal
  410.     and C compilers.  In these cases the value of the first byte is always between
  411.     $80 and $9F, or with bit 7 removed, between $00 and $1F.  For $00, the second
  412.     byte is the length of the symbol with that many bytes following the second
  413.     byte (thus a max length of 255). Values $01 to $1F represent the length itself.
  414.     A pad byte may follow these variable length cases if the symbol does not end
  415.     on a word boundary.  Following the symbol and the possible pad byte is a word
  416.     containing the size of the constants (literals) generated by the compiler.
  417.     
  418.     Note that if symStart actually does point to a valid MacsBug symbol, then you
  419.     may use showMacsBugSymbol to convert the MacsBug symbol bytes to a string that
  420.     could be used as a DC.B operand for disassembly purposes.  This string
  421.     explicitly shows the MacsBug symbol encodings.
  422.     */
  423.  
  424.  
  425. extern char *endOfModule(void *address, void *limit, char *symbol,
  426.                                                  void **nextModule);
  427.     /*
  428.     Check to see if the specified memory address, contains a RTS, JMP (A0) or
  429.     RTD #n instruction immediately followed by a valid MacsBug symbol.  These
  430.     sequences are the only ones which can determine an end of module when MacsBug
  431.     symbols are present.  During the check, the instruction and its following
  432.     MacsBug symbol must be fully contained in the bytes starting at the specified
  433.     address parameter, up to, but not including, the byte pointed to by the limit
  434.     parameter.
  435.  
  436.     If the end of module is NOT found, then NULL is returned as the function's
  437.     result.  However, if a end of module is found, the MacsBug symbol is returned
  438.     in symbol (if it is not NULL) as a null terminated Pascal string (with trailing
  439.     blanks removed), and the functions returns the pointer to the start of the
  440.     MacsBug symbol (i.e., address+2 for RTS or JMP (A0) and address+4 for RTD #n).
  441.     This address may then be used as in input parameter to showMacsBugSymbol to
  442.     convert the MacsBug symbol to a Disassembler operand string.
  443.     
  444.     Also returned in nextModule is where we think the FOLLOWING module begins. In
  445.     the "old style" cases (see validMacsBugSymbol) this will always be 8 or 16
  446.     bytes after the input address.  For new style the Apple Pascal and C cases this
  447.     will depend on the symbol length, existence of a pad byte, and size of the
  448.     constant (literal) area.  See validMacsBugSymbol for a description of valid
  449.     MacsBug symbol formats. 
  450.     */
  451.     
  452.  
  453. extern char *showMacsBugSymbol(char *symStart, void *limit, char *operand,
  454.                                                              short *bytesUsed);
  455.     /*
  456.     Format a MacsBug symbol as a operand of a DC.B directive.  The first one or two
  457.     bytes of the symbol are generated as $80+'c' if they have there high high bits
  458.     set.  All other characters are shown as characters in a string constant.  The
  459.     pad byte, if present, is one is also shown as $00.
  460.     
  461.     This routine is called to check that the bytes pointed to by symStart represent
  462.     a valid MacsBug symbol.  The symbol must be fully contained in the bytes
  463.     starting at symStart, up to, but not including the byte pointed to by the limit
  464.     parameter.
  465.     
  466.     When called, showMacsBugSymbol assumes that symStart is pointing at a valid
  467.     MacsBug symbol as validated by the validMacsBugSymbol or endOfModule routines.
  468.     As with validMacsBugSymbol, the symbol must be fully contained in the bytes
  469.     starting at symStart up to, but not including, the byte pointed to by the end
  470.     parameter.
  471.     
  472.     The string is returned in the 'operand' parameter as a null terminated Pascal
  473.     string.  The function also returns a pointer to this string as its return
  474.     value (NULL is returned only if the byte pointed to by the limit parameter is
  475.     reached prior to processing the entire symbol -- which should not happen if
  476.     properly validated).  The number of bytes used for the symbol is returned in
  477.     bytesUsed.  Due to the way MacsBug symbols are encoded, bytesUsed may not
  478.     necessarily be the same as the length of the operand string.
  479.     
  480.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  481.     upper/lower case letters in a format determined by the first two bytes of the
  482.     symbol as described in the validMacsBugSymbol routine.
  483.     */
  484.  
  485. #ifdef __cplusplus
  486. }
  487. #endif
  488. #endif
  489.